package net.w3blog.uniwifi.uniwifi;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class Preferences {
	private SharedPreferences prefs;
	private Editor editor;
	
	public Preferences(Context context){
		prefs = context.getSharedPreferences("buwifi", 0);
		editor = prefs.edit();
	}

	public boolean isFirstRun(){
		return prefs.getBoolean("firstRun", true);
	}
	
	public void setFirstRun(){
		editor.putBoolean("firstRun", false);
		editor.commit();
	}
	
	public String getUsername(){
		return prefs.getString("username", "");
	}
	
	public void setUsername(String username){
		editor.putString("username", username);
		editor.commit();
	}
	
	public String getPassword(){
		return prefs.getString("password", "");
	}
	
	public void setPassword(String password){
		editor.putString("password", password);
		editor.commit();
	}
}
